/**
 * 填充滚动图片  参数filmList的元素可能小于所需图片的数量
 * @param filmList
 */
function index_function_fillFilmBigList(filmList){
       let min= filmList.length > index_$li.length
                             ? index_$li.length
                              : filmList.length ;
        let max = filmList.length > index_$li.length
                                    ? filmList.length
                                    : index_$li.length;
        for(let i=0;i<min;i++){
                let $li = index_$li.eq(i);
                let film = filmList[i];
                $li.find("a").attr({href:FilmUrl+common_about+"?title="+film.title+"&type="+film.type});
                $li.find("img").attr({src:FilmUrl+film._1740x1036pict});
        }
        if(max>min){
                for(let i=max-1 ; i>=min ; i--){
                        let $li = index_$li.eq(i);
                        $li.remove();
                }

        }
}

/**
 * 填充小图片  参数filmList的元素
 * @param filmList
 */
function index_function_fillFilmLittlePict(filmList) {
     for(let i=0;i<index_$latest_movie.length;i++){
        let $div = index_$latest_movie.eq(i);
        let film = filmList[i];
       $div.find("a").get(0).href=FilmUrl+common_about+"?title="+film.title+"&type="+film.type;
       $div.find("img").get(0).src=FilmUrl+film._540x488pict;
    }
}

/**
 * 填充影片列表
 * @param filmMap
 */
function index_function_fillFilmListByType(filmMap) {

     for(let i=0;i<index_$section_title.length;i++){
        let $h2 = index_$section_title.eq(i);
        let $li = $h2.parent().find("li");
        let filmList = filmMap[$h2.html()];
        let count = $li.length >filmList.length ? filmList.length : $li.length ;
        for(let i=0;i<count;i++){
                let film = filmList[i];
                let $l = $li.eq(i);


               $l.find("div[class='date']").get(0).innerHTML=dateFormat("YYYY-mm-dd",convertDateFromString(film.releaseDate));
                let a = $l.find("a").get(0);
                a.href=FilmUrl+common_about+"?title="+film.title+"&type="+film.type;
                a.innerHTML=film.title;
        }
    }
}